package com.ruicar.afs.cloud.basic.api.product.feign;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.basic.api.dto.LprQueryDto;
import com.ruicar.afs.cloud.basic.api.dto.ProductInfoDTO;
import com.ruicar.afs.cloud.basic.api.dto.ProductPlanDataVo;
import com.ruicar.afs.cloud.basic.api.dto.ProductPrototypeDto;
import com.ruicar.afs.cloud.common.core.feign.annotations.AfsFeignClear;
import com.ruicar.afs.cloud.common.core.query.QueryCondition;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;
import java.util.Map;

@FeignClient(name = "product", url = "${com.greatwall.services.product-service.url}")
public interface ProductServiceFeign {

    @PostMapping(value = "/productPlan/getProductDetails", headers = {"clientId=${com.greatwall.services.product-service.clientId}", "clientSecret=${com.greatwall.services.product-service.clientSecret}"})
    @AfsFeignClear(true)
    IResponse<JSONObject> queryProductDetails(@RequestBody ProductInfoDTO info);


    @PostMapping(value = "/productPlan/getProductPlanDataByProductId", headers = {"clientId=${com.greatwall.services.product-service.clientId}", "clientSecret=${com.greatwall.services.product-service.clientSecret}"})
    @AfsFeignClear(true)
    IResponse<List<ProductPlanDataVo>> getProductPlanDataByProductId(@RequestBody ProductInfoDTO info);

    @ApiOperation("查询产品方案信息数据")
    @PostMapping(value = "/productPlan/queryProductProposalList", headers = {"clientId=${com.greatwall.services.product-service.clientId}", "clientSecret=${com.greatwall.services.product-service.clientSecret}"})
    IResponse queryProductProposalList(@RequestBody QueryCondition<ProductPrototypeDto> planCondition);

    @ApiOperation("查询lpr利率")
    @PostMapping(value = "/lpr/getLprNew", headers = {"clientId=${com.greatwall.services.product-service.clientId}", "clientSecret=${com.greatwall.services.product-service.clientSecret}"})
    IResponse getLprNew(@RequestBody LprQueryDto lprQueryDto);

}
